package com.boot.springboot.service.serviceImpl;

import com.boot.springboot.dao.UserDao;
import com.boot.springboot.entity.User;
import com.boot.springboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;
@Service
public class ServiceImpl implements UserService {
    @Autowired
    UserDao userDao;
    @Override
    public void register(User user) {
        user.setId(UUID.randomUUID().toString());
        userDao.save(user);
    }

    @Override
    public User login(String username, String password) {
        return userDao.login(username,password);
    }
}
